import request from '@/utils/request/request';

// 分页查询
export function getPage(params) {
  return request.get('/api/procurement/order/order-change-main/page', {
    params,
  });
}
// 删除采购订单变更主数据
export function deleteOrder(id: string) {
  return request.delete(`/api/procurement/order/order-change-main/${id}`);
}
// 提交审批
export function submitApproval(data: any) {
  return request.post(
    '/api/procurement/order/order-change-main/submitApproval',
    data
  );
}
// 子分页查询
export function getDetailPage(params) {
  return request.get('/api/procurement/order/order-change-detail/page', {
    params,
  });
}
// 保存采购订单变更(主信息+明细+附件)
export function saveHandle(data: any) {
  return request.post('/api/procurement/order/order-change-main', data);
}
// 保存采购订单变更(主信息+明细+附件)
export function editHandle(data: any) {
  return request.put('/api/procurement/order/order-change-main', data);
}
// 通过id获得采购订单变更信息(主信息+附件)
export function changeOrder(id: string) {
  return request.get(`/api/procurement/order/order-change-main/${id}`);
}
// 生成正文
export function createContent(data: any) {
  return request.post(
    '/api/procurement/order/order-change-main/createContent',
    data
  );
}
